Method and device for decoding bar codes

ABSTRACT

A method and apparatus for decoding one or more bar codes comprising a plurality of marks, the marks comprise one or more spaces and one or more bars. The method comprises the following steps: digitalizing electrical signals obtained from a pick-up for picking up reflected laser beams; deriving the width of bars and spaces from the digital signals; determining one or more mark values with a degree on the basis of the width of the spaces and bars found inside the mark or in the immediate vicinity of the mark; determining one or more information values with a degree from the mark values with a degree; and selecting the most probable information values for a bar code or part of a bar code using the determined information values.

BACKGROUND

Use is being made on increasingly large scale and in many differentfields of bar codes, for instance in supermarkets but also for stockcontrol and the like. Using bar codes stock control is improved, transitspeed is increased and more accurate specifications of supplied goodscan be given to the buyer, such as the consumer.

It is still a regular occurrence however that a bar code is not decodedat the first reading by a scanning device. This can be due for instanceto a differing width of a bar or space, as well as to the inhomogeneityof the paper on which the bar pattern is printed, noise occurring forinstance as a result of ambient influences or caused by analogelectronics, thermal noise and/or variations in the scanning equipmentused.

Known scanning devices, for instance making use of laser beams, of CCD(Charge Coupled Devices) image recorders and/or making use of RF (RadioFrequency) induction and methods for decoding bar codes are widelydescribed in the patent literature, for instance in the nonpre-published European patent applications 952015097 and 952021939 ofapplicant.

Also known from EP 0439682 is a method and device according to theprecharacterising part of claims 1 and 8 respectively.

SUMMARY OF THE INVENTION

The present invention provides a method for decoding one or more barcodes comprising a plurality of marks, such as information marks,separation marks and the like, wherein each of the marks comprises oneor more spaces and one or more bars wherein each bar or space is formedby at least one module, and wherein the method comprises the steps of:

digitalizing electrical signals obtained from a pick-up, for instance apick-up for picking up reflected laser beams;

deriving from the obtained electrical signals for each barcode timepairs, each of which is formed by the combined width of a bar and anadjacent space;

deriving from said time pairs mark values indicating the number ofmodules covered by each time pair;

characterized by:

applying membership functions to said mark values to determine themembership degree with which each mark value has a length of an integernumber of modules;

determining from the mark values and their membership degrees thepossible information values represented by the barcode and theirmembership degrees, using a predetermined relationship between markvalues and information values; and

selecting the most probable information values for a bar code or partthereof using the determined information values and their membershipdegrees.

It has been demonstrated in practice with the method according to thepresent invention that difficult bar patterns are also recognized morequickly. In addition, the present invention provides a device forscanning and decoding bar patterns.

The present invention further provides an apparatus for decoding one ormore barcodes comprising a plurality of marks, such as informationmarks, separation marks and the like, wherein each of the markscomprises one or more spaces and one or more bars wherein each bar orspace is formed by at least one module, and wherein the apparatuscomprises:

means for digitalizing electrical signals obtained from a pick-up, forinstance a pick-up for picking up reflected laser beams;

means for deriving from the obtained electrical signals for each barcodetime pairs, each of which is formed by the combined width of a bar andan adjacent space;

means for deriving from said time pairs mark values indicating thenumber of modules covered by each time pair;

characterized by:

means for applying membership functions to said mark values to determinethe membership degree with which each mark value has a length of aninteger number of modules;

means for determining from the mark values and their membership degreesthe possible information values represented by the barcode and theirmembership degrees, using a predetermined relationship between markvalues and information values; and

means for selecting the most probable information values for a bar codeor part thereof using the determined information values and theirmembership degrees.

deriving the width of bars and spaces from the digital signals;

determining one or more mark values with a degree on the basis of thewidth of the spaces and bars found inside the mark or in the immediatevicinity thereof;

determining one or more information values with a degree from the markvalues with a degree; and

selecting the most probable information values for a bar code or partthereof using the determined information values.

It has been demonstrated in practice with the method according to thepresent invention that difficult bar patterns are also recognized morequickly. In addition, the present invention provides a device forscanning and decoding bar patterns.

The present invention further provides a device for decoding bar codes.

BRIEF DESCRIPTION OF THE DRAWINGS

Further advantages, features and details of the present invention willbe detected on the basis of the following description wherein referenceis made to the annexed drawings, in which:

FIG. 1 shows an EAN-13 bar pattern;

FIG. 2 shows a table of the information marks used in an EAN-13 symbol;

FIG. 3 shows an overview of the auxiliary marks used in an EAN-13symbol;

FIG. 4 shows a block diagram for decoding a bar pattern;

FIG. 5 shows a detail of FIG. 4;

FIG. 6 shows an example of the use of the diagram of FIG. 5;

FIG. 7 shows an example of the processing of the data of FIG. 6;

FIGS. 8-12 show examples of membership functions for various componentsof a bar code;

FIG. 13 shows a diagram in which the location of the regions P, Q, R0and Rx is designated;

FIG. 14 shows a table for determining information marks on the basis ofvalues of P and Q;

FIG. 15 shows a table for determining information marks on the basis ofvalues of P, Q and R0;

FIG. 16 shows a table in which the possible order permutations are givenfor left and right halves of an EAN-13 symbol;

FIG. 17 shows an example of the content of the relevant registers of thesecond data pipe of FIG. 4;

FIG. 18 shows a block diagram of a system incorporating a preferredembodiment of a decoding device according to the present invention;

FIG. 19 shows a block diagram of the decoding device of FIG. 18;

FIG. 20 shows a block diagram of the FPGA of FIG. 19; and

FIG. 21 shows a block diagram of the filter of FIG. 20.

DETAILED DESCRIPTION

The present invention is applicable to EAN-13 patterns (see the Handbookof Uniform Article Coding of the UAC Foundation), but can likewise beapplied for EAN-8, UPCA, UPCE, in addition to industrial codes CODE-128,CODE-39, CODABAR, 20F5, etc.

During reading of bar codes errors can be introduced as a result ofdiverse causes. During printing of a bar code on a packaging variationscan occur, for instance due to shifting during making of the film mask,the manufacture of the printing plates, the pressure of the printingplates on the carrier, absorption of the paper etc. The colour contrastis not always optimal since producers attempt to integrate the barpattern as much as possible into the packaging. Deformation of thepackaging can occur.

Errors can further be introduced by deformation of the packaging.

In addition, errors can occur during scanning which can be ascribed tothe optics, the analog electronics, as well as to digitalizing of analogsignals. Finally, ambient influences, such as dirt, moisture or damageto the packaging, can introduce errors.

A greater part of the errors in reading the above mentioned bar codescan be traced back to the shifting of boundaries between bars andspaces. A significant part of these errors are systematic errorsmanifesting themselves in a form described as average print widening.Herein the derived widths of all bars in the bar code are an amountdelta larger than in an ideal bar code, while the widths of the spacesin the bar codes are the same amount delta smaller.

An EAN-13 symbol or bar pattern comprises a separation mark with 6information marks on either side flanked on the outsides by an edge mark(FIG. 1). The symbol is moreover provided with a left and a right-handmargin. The left half comprises 6 information marks from the numberseries A and B, while the right half comprises 6 information marks fromthe number series C (see FIG. 2). Noticeable is that the patterns fromthe number series C are exact mirror images of the patterns from thenumber series B.

Auxiliary marks and information marks are built up of bars and spaceswhich both comprise a whole number of units or modules (see FIG. 3). Amodule has a fixed width within a symbol. Beneath the symbol is therepresentation of the thirteen digit article number which is legible forpeople.

The present decoding method is suitable for both forward and backwarddecoding. Since in terms of structure the right half of an EAN-13 codecorresponds in mirror image with a left half, this code can be readinward, i.e. decoding from an edge mark to the separation mark, or readoutward, i.e. from the separation mark to an edge mark. The signal MARKindicates with the value 1 that decoding must take place from outside toinside and with the value 0 that it must take place in reversedirection. Whether this involves a left or a right half is ultimatelydetermined with reference to the number series of the information marks.The signal MARK changes polarity each time the width of a bar or spaceis determined, so that decoding takes place alternately from outside toinside and vice versa.

The decoding process for EAN-13 symbols is built up of three parts (seealso FIG. 4):

decoding of information marks

constituting bar code halves

constituting and selecting the most probable bar code.

In decoding EAN-13 codes according to the a present invention so-calledtime pairs are taken as starting point (FIG. 5). A time pair is obtainedby adding together the widths of a bar and an adjacent space. For eachbar a time pair is formed with the preceding space as well as a timepair with the following space. The time pairs P and Q used in thepresent invention are shown in FIG. 2. The advantage of this manner ofoperation is that the problem of the average print widening iscompletely resolved. The time pairs are placed in a so-called data pipe.This data pipe consists of 15 registers. Each time a new time pair iscalculated the content of the data pipe shifts up one register to makeroom for the new time pair. The content of register 14 herein disappearswhile the new time pair is placed in register 0.

EXAMPLE: FIG. 6 illustrates how the fill of the data pipe looks with agiven bar pattern.

Each time a new time pair is placed in the data pipe, it is assumed thatan information mark is present and an attempt is made to decode themark. The width and position of the information mark is fixed with twotime pairs. If MARK has the value 1, the time pairs in registers 8 and10 determine the width and if MARK has the value 0 the registers 4 and 6determine the width. With this manner of operation not a singleinformation mark is skipped, and in any case with the correct polarityof MARK all information marks end up at some point in the said positionsof the data pipe.

The information mark in question is situated between an edge mark and aninformation mark or between two information marks or between aninformation mark and the separation mark (see FIG. 1). To enable placingof the mark during constituting of a bar code half, a check is made foreach information mark as to whether it adjoins a separation mark or aninformation mark on the one side and whether it adjoins an edge markwith associated margin on the other side. To make these checks possiblea data pipe is chosen with a length of 15 registers. A different lengthwould however also have been possible.

The present decoding method has a large dynamic range in that the widthof the information mark is used as reference for determining the contentof the information mark and also for checking the auxiliary marks. Alarge dynamic range is particularly important for a laser scanner, a barcode can in any case have diverse dimensions and can be situated closeto the scanner or at a greater distance. Since an information mark in anEAN-13 symbol nominally has a fixed dimension of 7 modules, this widthis suitable for use as reference. A subsequent step in the decodingprocess is that all relevant time pairs are standardized to thisreference. Since decoding from inside to outside relative to decoding inthe reverse direction amounts in fact to a mirror image in register 7 interms of interpreting the data pipe, the mirror image is or is notexecuted depending on MARK during standardization.

If MARK has the value 1:

    M3=(T3*7)/(T8+T10)

    M4=(T4*7)/(T8+T10)

    M5=(T5*7)/(T8+T10)

    M6=(T6*7)/(T8+T10)

    M7=(T7*7)/(T8+T10)

    M8=(T8*7)/(T8+T10)

    M9=(T9*7)/(T8+T10)

    M11=(T11*7)/(T8+T10)

    M12=(T12*7)/(T8+T10)

    M13=(T13*7)/(T8+T10)

    M14=(T14*7)/(T8+T10)

If MARK has the value 0:

    M3=(T11*7)/(T6+T4)

    M4=(T10*7)/(T6+T4)

    M5=(T9*7)/(T6+T4)

    M6=(T8*7)/(T6+T4)

    M7=(T7*7)/(T6+T4)

    M8=(T6*7)/(T6+T4)

    M9=(T5*7)/(T6+T4)

    M11=(T3*7)/(T6+T4)

    M12=(T2*7)/(T6+T4)

    M13=(T1*7)/(T6+T4)

    M14=(T0*7)/(T6+T4)

Herein Tx is the content of the register x of the data pipe. Thevariable Mx can be interpreted as the number of modules covered by thetime pair x. It should be noted herein that both Tx and Mx belong inprinciple to the set of the real numbers, although for an implementationwhole or fixed point numbers will generally be chosen.

EXAMPLE: FIG. 7 shows for both values of MARK and a fill of the datapipe the associated values of Mx.

Each bar or space of an information and auxiliary mark consists of awhole number of modules. In conventional decoding methods the Mx numbersare rounded off to the nearest whole number. In the present decodingmethod however, no discretization but fuzzification takes place byapplying membership functions per relevant whole value. As is usual inthe fuzzy set theory the membership functions always produce a realnumber or degree which is greater than or equal to 0 and smaller than orequal to 1. A degree of 0 corresponds with the logical value FALSE and 1corresponds with TRUE. Another range is of course possible which mayalso comprise negative numbers.

FIG. 8 gives examples of membership functions which are applied to M8and M9. The regions in FIG. 13 corresponding with M9 and M8 aredesignated respectively with the symbols P and Q. As can be derived fromthe table in FIG. 2, P and Q can only have the values 2, 3, 4 and 5. Inthe present method these values correspond with a set of F2, F3, F4 andF5 which each have their own membership function. P contains a subsethereof, i.e. those values for which the associated membership functionhas a degree greater than 0 for a given M9. In the same manner Qcontains a subset associated with a given M8. The sets P and Q may beempty or may contain one or more elements.

EXAMPLE: In FIG. 7, M8 has the value 1.98 and M9 has the value 2.41 inthe case MARK is 0. With the membership functions of FIG. 8, P obtainsthe elements 2 (0.65) and 3 (0.35) and Q the element 2 (1.0), whereinthe degree is shown in brackets.

Shown in FIG. 14 is the value or values of the information mark for eachcombination of elements of P and Q and also to which series it belongs.From the table can be seen that for combinations with elements 3 and 4of P and Q it is not possible to make an unambiguous statement about thevalue of the information mark. The choice is made at a later stageduring constituting of the bar code halves. In order to provide theinformation required for this choice the set of values associated withthe region designated R0 in FIG. 13 is also taken into consideration inthe selection of the information mark. For this purpose the set ofpossible information marks is increased in the present decoding methodfrom 20 {A0, A1, . . . ,A9, B0, B1, . . . ,B9} to 80 elements {1A0, 2A0,3A0, 4A0, 1A1, . . . . , 4A9, 1B0, . . . . , 4B9}. The number to theleft of the series indication denotes of how many modules the bardirectly adjacent the information mark must consist. This number is 1,2, 3 or 4 modules.

The set R0 is determined with membership functions of M11 such as forinstance the functions F2 to F8 shown in FIG. 9. The set of possibleinformation marks is a subset of the extended set of 80 informationmarks. The subset is found by combining elements of P, Q and R0 andlooking up the combinations in the table in FIG. 15. To each informationmark is assigned a degree which is calculated with a FUZZY-AND functionor an algebraic product function of the degrees of the associatedelements of P, Q and R0.

EXAMPLE: In FIG. 7, M11 has the value 4.62 in the case MARK is 0. Withthe membership functions of FIG. 9, R0 obtains the elements 4 (0.30) and5 (0.70). Together with the elements of P and Q from the previousexample, this gives the following possibilities for the informationmark:

1B6 (0.46)

1A0 (0.11)

2A0 (0.25)

The degree placed in brackets is calculated with the algebraic productof the separate degrees.

In the decoding of an information mark a check is always made for thepresence of auxiliary marks. As shown in FIG. 3, the separation markconsists of 2 bars and 3 spaces, each comprising one module. The checktakes place by fuzzification of M3, M4, M5 and M6 using a membershipfunction F2, an example of which is given in FIG. 10. M7 is moreoveralso checked, which corresponds with the region designated with thesymbol Rx in FIG. 13. As in the case of P and Q, this is a set which cancontain the values 2, 3, 4 and 5. The membership functions of FIG. 8 arefor instance suitable for determining the set Rx and the associateddegrees. The region Rx lies partly in the information mark and partly inthe separation mark. One module lies in the separation mark and the restin the information mark. In a given information mark the number ofmodules of the outside bar is known, as shown in FIG. 2. This means thatfor every possible information mark a check is made as to whether itadjoins a separation mark. The degree of the auxiliary mark iscalculated with a FUZZY-AND function of the degrees associated with M3to M6 and the degree of the suitable element of Rx.

An edge mark consists of two bars and a space (see also FIG. 3). Thecheck takes place as in the case of the separation mark by fuzzificationusing a membership function F2, in this case of M12 and M13. In contrastto the separation mark, no additional check need be performed for aregion having an overlap with the information mark. The region R0 is inany case already involved in decoding that mark. This means that thepresence of the edge mark does not depend on the content of theinformation mark. The degree of the edge mark is determined with aFUZZY-AND function of the degrees associated with M12 and M13.

In an EAN-13 symbol different requirements are generally made of theleft and right margin. Since it is not yet known at this stage ofdecoding whether an information mark forms part of a left or right halfof the symbol, a check is made as to the presence of a left margin aswell as a right margin. A membership function of M14 such as forinstance Fmarg in FIG. 11 determines the presence and the associateddegree. Different functions can therein be used for the left and rightmargin.

Finally, one further check is performed in the decoding of aninformation mark relating to the dimensions of mutually adjacentinformation marks. In the ideal case the marks within an EAN-13 symbolare equally wide, since they anyway each contain seven modules. Inpractice differences occur. The standardized width of a possiblyadjacent information mark is found by adding M4 and M6. With amembership function such as for instance Finter in FIG. 12 is determinedwhether the mutual width ratio is correct and which degree is associatedtherewith.

In summary, it can be stated that at the level of decoding aninformation mark, at each fill of the data pipe the followinginformation is determined and subsequently made available to the part ofthe decoding method in which halves are constituted:

A set of possible information marks from the extended set of 80 marks,each provided with a degree.

For each information mark the presence of a separation mark withassociated degree.

The presence of an edge mark with degree.

The presence of a left margin with degree.

The presence of a right margin with degree.

The width ratio with an adjacent information mark with a degree.

In order to constitute bar code halves the thus obtained data is againplaced in a data pipe (see also FIG. 4). This data pipe consists of 21registers. Each time new data is calculated the content of the data pipeshifts up one register to make room for the new data. The content ofregister 20 herein disappears while the new information is placed inregister 0. The data pipe has branches at the registers 0, 4, 8, 12, 16and 20, so that the data of six adjacent information marks becomesavailable. It is assumed herein that these six registers togethercomprise one or more bar code halves.

As in the decoding of information marks, the signal MARK here alsoindicates whether decoding must take place from inside to outside or inreverse direction. MARK indicates with the value 1 that register 0 andwith the value 0 that register 20 contains the information mark whichadjoins the separation mark. With this manner of operation not a singlebar code half is skipped, and in any case with the correct polarity ofMARK all halves end up at some point in the said positions of the datapipe.

Constituting of bar code halves commences from the separation mark. Itis however equally possible to start from the edge mark. As alreadystated above, a start is made with register 0 if MARK has the value 1and a start is made with register 20 if MARK has the value 0. Thisregister contains a set of possible information marks. A start is onlymade with those marks which have a flag indicating the presence of aseparation mark. As stated in the foregoing, each possible informationmark comprises in addition to a numeric value and the series indicationa value which designates of how many modules the adjoining bar in theadjacent mark must consist. All possibilities for the adjacentinformation mark meeting this requirement, while the mutual width ratiois moreover correct, are tried. This process, which is typically a formof so-called backtracking, is continued until the possibilities are alsofound for the information mark situated adjacently of the edge mark. Forthese latter information marks the limitation applies that the adjacentbar comprises only one module, since this is anyway a bar of the edgemark. In addition, the edge mark itself must be present.

EXAMPLE: In FIG. 17 the content of the data pipe is shown for the sixbranches. The paths found with the backtracking algorithm are designatedwith arrows. A path starts on the right of the figure with aninformation mark located adjacently of a separation mark (designatedwith S). A start is made with the marks 1B6 and 1A0. Adjacently of thesemarks must be an information mark having an outside bar consisting ofone module. Both 1B7 and 1A1 meet this requirement. The width ratio ofthe adjacent information marks must moreover be correct. This isindicated with the flag ▪inter▪ which must have a degree greater thanzero. The arrows indicate in each case which information marks meetthese requirements and thus fit. The sixth information mark must fitnext to an edge mark and in addition that edge mark must also be presentwith a margin. In this manner eight possible halves are generated:

B6-B0-B9-B8-B7-B6

A0-B0-B9-B8-B7-B6

B6-B0-B9-B8-A1-B6

A0-B0-B9-B8-A1-B6

B6-B0-B9-B8-B7-A0

A0-B0-B9-B8-B7-A0

B6-B0-B9-B8-A1-A0

A0-B0-B9-B8-A1-A0

Since at this stage six adjoining information marks have been found, theorder permutation can also be checked. Only the permutations occurringin FIG. 16 are valid. The table shows whether it is a left or a rightbar code half. Subject hereto, a check is also made as to the presenceof a left or right margin. For a left half the table moreover gives thenumber which is printed in an EAN-13 symbol under the left margin andwhich is legible for people.

The backtrack method together with the additional checks gives a set ofpossible bar code halves. The set can be empty. Every possibility isprovided with a degree which is calculated with a FUZZY-AND function ofthe degrees of the separate parts. The degrees of auxiliary marks areherein given a different weighting.

EXAMPLE: From the eight possible halves of the previous example, onlytwo possibilities remain after checking the order permutation using FIG.16:

B6-B0-B9-B8-B7-B6=right half 678906

A0-B0-B9-B8-A1-A0=left half 6₁₃ 009810

All possible bar code halves are transmitted with associated degrees tothe part of the decoding method in which the halves are constituted tocomplete bar codes.

When constituting bar codes, bar code halves are collected for adetermined time. In order to reduce the amount of data, for identicalhalves the number of times this half occurs is recorded. The degree isherein enhanced with a FUZZY-OR function of the degree which applied tothe halves collected up to that point and the degree of the new half.After collection the left halves are combined with the right halves. Fora possible bar code the control number, the number in the right halfnext to the edge mark, must correspond to a modulo calculation of theother numbers. The degree of the bar code is calculated with a FUZZY-ANDfunction of the degrees of the left and right halves, wherein the numberof times the halves have occurred is taken into account.

If the set of possible bar codes comprises more than one element andthere is clearly one bar code with a higher degree than the others, thisbar code is generated as the most probable code. In other cases thenumber of times a half is found or the sequence in which the halves arefound may determine the choice.

EXAMPLE: After a determined collection time the following bar codes arefound:

right half 678906 with degree 0.80 and found 10 times

left half 6₁₃ 009810 with degree 0.15 and found twice left half 8₁₃712345 with degree 0.95 and found 25 times

right half 567815 with degree 0.05 and found once

right half 876906 with degree 0.12 and found 3 times.

8 combinations are hereby possible. However, only two of thecombinations have a correct control number:

8₁₃ 712345₁₃ 678906 with degree 0.76

8₁₃ 712345-876906 with degree 0.11

On the basis of the degree the first code is generated.

The membership functions form an essential part of the presentinvention. The functions can differ for information marks and auxiliarymarks and can even differ per component of a mark. In the examplesmembership functions with a trapezoid form are used. A function withthis form can be described with four vertices or a so-called trapeziumquartet. Such a form can provide advantages in implementation. This doesnot however by any means exclude other forms for the membershipfunctions in view of the great influence the choice has on theperformance of the decoding method.

There are also various alternatives for the FUZZY-AND function,including the algebraic product and minimum functions. Similar functionsare possible for the FUZZY-OR. Where necessary a square root or a rootof a higher order may be taken of a degree with the purpose of givingthe degree a smaller weighting in the evaluation of fuzzy logicalexpressions. There are however other possible methods of applying aweighting, such as for instance a weighted average.

The above described decoding method is also applicable to UPCA codes, asthese codes correspond with EAN-13, wherein the left half contains onlyinformation marks from the A series (see FIG. 2). The method isapplicable to UPCE codes. These codes correspond with a left half of anEAN-13 code. There is a difference in the use of order permutations,edge marks and margins. The method is further applicable to EAN-8 codes,which are in fact a shorter version of EAN-13 codes.

First results with the above described embodiment of the methodaccording to the present invention have been obtained using a computerprogram and a printed circuit board developed for this purpose for apersonal computer which is connected to a laser scanner. From a largenumber of measuring results the conclusion can be drawn that forrepresentative situations for cash registers in supermarkets, thedecoding method according to the present invention has a higher degreeof first time correct reading. It has also been found that in someconditions the decoding method according to the present invention findsa correct solution while this was not possible at all with the existingdecoding algorithm due to poor print quality.

A system 20 (FIG. 18) comprises a laser scanner 21, a decoding device 22and a cash register 23. The decoding device 22 and the cash register 23are connected via a serial line according to the RS232 protocol. Thelaser scanner 21 which was used in the present example gives threesignals to the decoding device 22, i.e. BTW, WTB and JAM whichrespectively designate black to white transitions, white to blacktransitions and a strong increase in contrast in the bar codes scannedby the laser scanner 21. The decoding device 22 gives a signal BEEP tothe scanner 21 with indicates that the bar code is detected. This signalis converted by the laser scanner 21 into a signal which is audible tothe user and/or visible on for instance a LED. The decoding device 22comprises an FPGA (Floating Point Gate Array) 24, a FIFO (First in Firstout) memory 25, a microprocessor 26, a memory of the ROM type 27, amemory of the RAM type 28 and a serial port 29 for the serial RS232connection. The components 25, 26, 27, 28 and 29 are mutually connectedusing a bus structure 30.

By means of the FPGA, the operation of which will be explained furtherhereinbelow, the time pairs are determined as described above from theBTW, the WTB and JAM signals. The FIFO serves to absorb variations inthe supply of time pairs by the FPGA, so that they can be processed bythe microprocessor in the desired time frequency. Situated in the ROM 27is the software for the microprocessor 26 such as described in theforegoing and in particular for the functions of decoding informationmarks, constituting bar code halves, constituting bar codes from barcode halves and selecting bar codes. Stored in the RAM 28 are interimresults, such as the data pipe for time pairs, the data pipe forinformation marks and the decoded bar code halves. The microprocessor 26must have a high processing speed and in the present embodiment apentium processor of the Intel concern was used.

The FPGA 24 (FIG. 20) comprises a counter 31 to which a clock signal CLwith a frequency of 32 MHZ is connected, a filter 32, a first register33, a second register 34, a full-adder 35, control logic 36 for thecounter 31 and control logic 37 for the FIFO 25. The components aremutually connected in the manner outlined in FIG. 22. Using the counter31 the number of periods is determined between transitions from white toblack and vice versa. In this manner the width of all spaces and bars ofthe bar code are measured in time. At each transition the content of thecounter is placed in the filter, while the counter is set to the value 1by the control logic 36.

The filter, the operation of which will be further explainedhereinbelow, serves to reduce the amount of data. Time values whichcannot form part of a bar code are filtered out. The data which is notfiltered out is placed in register 33, while the content of register 33is shifted each time to register 34. Using the full-adder 35 thecontents of registers 1 and 2 are added together, so that a width of atime pair is present at the output of the full-adder. This value issubsequently written into the FIFO by the control logic therefor and isaccompanied by a bit MARK which designates whether the time pair is aspace followed by a bar or, conversely, a bar followed by a space.

A strong increase in contrast indicated with the signal JAM usuallymeans that the scan spot has come across a bar code after a light marginand that a space must be interpreted as a margin. The FPGA ensures thatthis space acquires the greatest possible width whereby it will meet thecriterion for a margin during decoding.

The filter 32 comprises a comparator 41, control logic 42 for thefilter, a register 43, 44 . . . 76, in accordance with the number ofelements of a (half of a) bar code, in the present case 33 time values.A limit value LV is further supplied to the comparator 41 from themicroprocessor 26, the value of which is adjustable or programmable. Inthe comparator 41 the input counter value is compared to the limit valueLV. A bar or space within a bar code must be smaller in time than adetermined limit value. The limit value is determined by the quotient ofthe maximum dimension of an element (space or bar) and the minimum speedof the spot of the laser scanner.

The registers 43-76 serve for temporary storage of the time value. Thecontrol 42 determines on the basis of the output of the comparator 41whether the value must be written in the registers.

In the present embodiment the starting point is the decoding of EAN-13halves. One half consists of three elements in the edge mark,twenty-four elements in the information marks and five elements in theseparation mark, i.e. a total of 32 elements (see also FIGS. 1, 2 and3). Only series of at least 32 time values which must rather be smallerthan the limit values are therefore accepted as suitable for decoding.If the time value preceding the series comprises the width of a spacethis value must be passed on with the series. This is because a left orright margin could in fact be involved here. The same applies for thetime value immediately following the series. The filter thus allowsthrough series of adjacent time values with a length of at least 33elements, for which purpose the filter comprises 33 registers.

It should be noted that it is of course possible to provide the filterwith a smaller number of registers for filtering out short series, whichsimplifies the structure of the filter but on the other hand decreasesthe data reduction.

No limitations should be derived from the embodiments extensivelydescribed above. The requested rights are determined by the followingclaims, within the scope of which very many variations are possible,such as the method of fuzzification, the application of fuzzy logic andfuzzy sets, the defuzzification, in addition to decoding algorithmsother than those described which make use of time pairs.

We claim:
 1. Method for decoding one or more barcodes comprising aplurality of marks, wherein each of the marks comprises one or morespaces and one or more bars wherein each bar or space is formed by atleast one module, and wherein the method comprises the stepsof:digitalizing electrical signals obtained from a pick-up for pickingup reflected laser beams; deriving from the obtained electrical signalsfor each barcode time pairs, each of which is formed by the combinedwidth of a bar and an adjacent space; deriving from said time pairs markvalues indicating the number of modules covered by each timepair;characterized by: applying membership functions to said mark valuesto determine the membership degree with which each mark value has alength of an integer number of modules; determining from the mark valuesand their membership degrees the possible information values representedby the barcode and their membership degrees, using a predeterminedrelationship between mark values and information values; and selectingthe most probable information values for a bar code or part thereofusing the determined information values and their membership degrees. 2.Method according to claim 1, wherein said predetermined relationshipdepends on the barcode type.
 3. Method as claimed in claim 2, whereinbar code halves are combined to possible whole bar codes with a certainmembership degrees.
 4. Method as claimed in claim 1, wherein theinformation values are combined to form barcode halves with membershipdegrees.
 5. Method as claimed in claim 4, wherein the recorded number oftimes an identical bar code half occurs is used to enhance themembership degree of the barcode half.
 6. Method as claimed in claim 1,wherein the most probable bar code is determined by choosing informationvalues with the highest membership degree.
 7. Method according to claim1, wherein additional checks on possible information values areperformed to decrease the number of possible information values. 8.Method as claimed in claim 1, wherein the membership functions of atrapezoid form are used.
 9. Apparatus for decoding one or more barcodescomprising a plurality of marks, wherein each of the marks comprises oneor more spaces and one or more bars wherein each bar or space is formedby at least one module, and wherein the apparatus comprises:means fordigitalizing electrical signals obtained from a pick-up for picking upreflected laser beams; means for deriving from the obtained electricalsignals for each barcode time pairs, each of which is formed by thecombined width of a bar and an adjacent space; means for deriving fromsaid time pairs mark values indicating the number of modules covered byeach time pair;characterized by: means for applying membership functionsto said mark values to determine the membership degree with which eachmark value has a length of an integer number of modules; means fordetermining from the mark values and their membership degrees thepossible information values represented by the barcode and theirmembership degrees, using a predetermined relationship between markvalues and information values; and means for selecting the most probableinformation values for a bar code or part thereof using the determinedinformation values and their membership degrees.
 10. Apparatus asclaimed in claim 9, comprising filter means for reducing the amount ofdata to be processed.